package day_240417;

public class StringConcat {

    public static String show(String connect, String... arr) {

        String result = "";
        for (int i = 0; i < arr.length; i++) {
            result += arr[i] + ((i < arr.length - 1) ? connect : " ");
        }
        return result;
    }

    public static void main(String[] args) {
        System.out.println(show("-whatever-", "Hello", "World", "!"));
    }
}
